package com.gxuwz.Market.business.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gxuwz.Market.business.dao.ServiceBranchDAO;
import com.gxuwz.Market.business.entity.ServiceBranch;
import com.gxuwz.core.pagination.Result;


@Service("serviceBranchService")
public class ServiceBranchImpl implements IServiceBranchService {
	@Autowired
	private ServiceBranchDAO serviceBranchDAO;

	@Override
	public ServiceBranch findById(int id) {
		// TODO Auto-generated method stub
		return serviceBranchDAO.findById(id);
	}

	@Override
	public List<ServiceBranch> findAll() {
		// TODO Auto-generated method stub
		return serviceBranchDAO.findAll();
	}

	@Override
	public Result<ServiceBranch> find(ServiceBranch serviceBranch, int page, int size) {
		// TODO Auto-generated method stub
		return serviceBranchDAO.find(serviceBranch, page, size);
	}

	@Override
	public List<ServiceBranch> findByProperty(String property, String value) {
		// TODO Auto-generated method stub
		return serviceBranchDAO.findByProperty(property, value);
	}

	@Override
	public void add(ServiceBranch serviceBranch) {
		// TODO Auto-generated method stub
		serviceBranchDAO.save(serviceBranch);

	}

	@Override
	public void delete(int id) {
		// TODO Auto-generated method stub
		ServiceBranch serviceBranch = serviceBranchDAO.findById(id);
		serviceBranchDAO.remove(serviceBranch);

	}

	@Override
	public void update(ServiceBranch serviceBranch) {
		// TODO Auto-generated method stub
		serviceBranchDAO.update(serviceBranch);

	}

	@Override
	public List<ServiceBranch> findByProperty2(String property, String value, String property2, String value2) {
		// TODO Auto-generated method stub
		return serviceBranchDAO.findByProperty2(property, value, property2, value2);
	}

}
